package com.one.rope.mvp.web.common.dto.user.business;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.one.rope.mvp.web.common.enums.MemberScaleEnum;
import com.one.rope.mvp.web.common.enums.ProjectProgressEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * <p>
 * 项目列表返回参数
 * <p>
 *
 * @author ： Weijian.Liu
 * @date ： 2020/3/16 23:30
 */
@Data
@ApiModel
public class ProjectListVO {

  @ApiModelProperty(value = "项目id")
  private Long id;

  @ApiModelProperty(value = "项目名称")
  private String name;

  @JsonIgnore
  private Integer memberScale;

  @ApiModelProperty(value = "成员规模")
  @JsonProperty("member_scale_str")
  private Integer memberScaleStr;

  @JsonIgnore
  private Integer projectProgress;

  @ApiModelProperty(value = "项目进展")
  @JsonProperty("project_progress_str")
  private Integer projectProgressStr;

  public String getMemberScaleStr() {
    if (null != memberScale) {
      return MemberScaleEnum.getName(memberScale);
    }
    return "";
  }

  public String getProjectProgressStr() {
    if (null != projectProgress) {
      return ProjectProgressEnum.getName(projectProgress);
    }
    return "";
  }
}
